import request from '@/utils/request'

// 查询公告附件列表
export function listNoticeAttach(query) {
  return request({
    url: '/system/noticeAttach/list',
    method: 'get',
    params: query
  })
}

// 按公告ID查得附件列表
export function listNoticeAttachById(noticeId) {
  return request({
    url: `/system/noticeAttach/byNotice/${noticeId}`,
    method: 'get',

  })
}

// 查询公告附件详细
export function getNoticeAttach(attachmentId) {
  return request({
    url: '/system/noticeAttach/' + attachmentId,
    method: 'get'
  })
}

// 新增公告附件
export function addNoticeAttach(data) {
  return request({
    url: '/system/noticeAttach',
    method: 'post',
    data: data
  })
}

// 修改公告附件
export function updateNoticeAttach(data) {
  return request({
    url: '/system/noticeAttach',
    method: 'put',
    data: data
  })
}

// 删除公告附件
export function delNoticeAttach(attachmentId) {
  return request({
    url: '/system/noticeAttach/' + attachmentId,
    method: 'delete'
  })
}
